<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<div class="row">
    <div class="col-lg-12">
        <div class="panel">
            <div class="panel-heading">
                <h3 class="panel-title">印章使用申请表</h3>
            </div>

            <!-- BASIC FORM ELEMENTS -->
            <!--===================================================-->
            <form id="form_seal_input" class="panel-body form-horizontal form-padding">
                <input type="hidden" name="keyId" id="keyId" value="${seal.id}" />
                <div class="form-group">
                    <label class="col-md-2 control-label">印章使用类型<i class="fa fa-asterisk txt-color-red"></i>
                        <span id="useTypeSpan" style="display: none">${seal.useType}</span>
                    </label>
                    <div class="col-md-6">
                        <input type="text" id="useType" name="useType" class="form-control" value="${seal.useType==1?'内部使用':'外借使用'}" disabled>

                        <%--<div class="radio">--%>
                            <!-- Inline radio buttons -->
                            <%--<input type="radio" name="useType" id="useType1Selected" class="magic-radio" value="1"--%>
                            <%--<c:if test="${seal.useType eq 1}"> checked="checked"</c:if> disabled>--%>
                            <%--<label for="useType1Selected">内部使用</label>--%>

                            <%--<input type="radio" name="useType" id="useType2Selected" class="magic-radio" value="2"--%>
                            <%--<c:if test="${seal.useType eq 2}"> checked="checked"</c:if> disabled>--%>
                            <%--<label for="useType2Selected">外借使用</label>--%>

                        <%--</div>--%>
                    </div>
                </div>

                <div class="form-group div-Hidden">
                    <label class="col-md-2 control-label">预计归还时间<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                            <div class="input-group date">
                                <input type="text" class="form-control" id="datPlanReturn" name="datPlanReturn" disabled
                                value=<fmt:formatDate pattern="yyyy-MM-dd" value="${seal.datPlanReturn}" /> >
                                <span class="input-group-addon"><i class="ti-calendar"></i></span>
                            </div>
                    </div>
                </div>

                <div class="form-group div-Hidden">
                    <label class="col-md-2 control-label">实际归还时间</label>
                    <div class="col-md-6">
                        <div class="input-group date">
                            <input type="text" class="form-control" id="datFactReturn" name="datFactReturn" disabled
                                   value=<fmt:formatDate pattern="yyyy-MM-dd" value="${seal.datFactReturn}" /> >
                            <span class="input-group-addon"><i class="ti-calendar"></i></span>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">印章名称<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="text" id="sealDictItem" name="sealDictItem" class="form-control" value="${seal.sealDictItem.name}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">使用事由<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="text" id="useReason" name="useReason" class="form-control" value="${seal.useReason}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">盖章份数<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="number" id="numSeal" name="numSeal" class="form-control" value="${seal.numSeal}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">附件</label>
                    <div class="col-md-6">
                        <input name="hiddenFiles" id="hiddenFilesAttachment" type="hidden" value="${seal.fileAttachment}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">提交人</label>
                    <div class="col-md-2">
                        <p class="form-control-static">${seal.creater.name}</p>
                    </div>
                    <label class="col-md-2 control-label">提交日期</label>
                    <div class="col-md-2">
                        <p class="form-control-static"><fmt:formatDate pattern="yyyy-MM-dd" value="${seal.dateApply}" /></p>
                    </div>
                </div>
            </form>
            <!--===================================================-->
            <!-- END BASIC FORM ELEMENTS -->

            <div class="panel-footer">
                <a class="btn btn-default" id="apply-re-common" href="javascript:void(0)">
                    <i class="fa fa-lg fa-mail-reply"></i> 返回视图
                </a>
                <c:if test="${seal.numStatus==0 && user.id==seal.creater.id}">
                    <a class="btn btn-warning" key="ajax_seal_edit" href="javascript:void(0);"><i class="fa fa-lg fa-edit"></i> 编辑表单 </a>
                </c:if>
            </div>
        </div>
    </div>
</div>

<script>

    // 附件显示
    readLoad({
        objId:"hiddenFilesAttachment",
        entityName:"fileAttachment",
        sourceId:"hiddenFilesAttachment"
    });

    //编辑
    $("a[key='ajax_seal_edit']").unbind("click").bind("click",function(){
        loadURL("<%=path%>/activiti/seal/edit/"+$("#keyId").val(),$('#page-content'));
    });

    //返回视图
    $("#apply-re-common").click(returnToHashUrl);

    // 加载完成后执行
    $(function(){
        if($("#useTypeSpan").text()=="1"){
            $(".div-Hidden").hide();
        }
    })

</script>




